package com.csst.business.action;

import net.sf.json.JSONObject;

import org.apache.struts2.ServletActionContext;

import com.csst.business.model.TTrUser;
import com.csst.business.service.TestService;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class TestAction extends ActionSupport{
	private TestService testService;
	private TTrUser user;
	
	public String testAction(){
		System.out.println("=============================");
		user = new TTrUser();
		user.setId("11111111112");
		user.setRealName("张三");
		user.setTuArea("北京");
		/*JSONObject jsonObject=new JSONObject();
		 jsonObject.accumulate("user", user);
		 jsonObject.accumulate("success", true);
		 //这里在request对象中放了一个data，所以struts的result配置中不能有type="redirect"
		  ServletActionContext.getRequest().setAttribute("data", jsonObject.toString());*/
		return SUCCESS;
	}
	
	public String test(){
		System.out.println("=============================");
		user = new TTrUser();
		user.setId("11111111112");
		user.setRealName("张三");
		user.setTuArea("北京");
		return "aaa";
	}
	

	public TestService getTestService() {
		return testService;
	}

	public void setTestService(TestService testService) {
		this.testService = testService;
	}

	public TTrUser getUser() {
		return user;
	}

	public void setUser(TTrUser user) {
		this.user = user;
	}
	
	
}
